package injectTest

import com.google.inject.Guice

/**
  * Created by liuwei on 2017/10/30.
  */
object AnimalServer {
  def main(args: Array[String]): Unit = {
    //    val cat = new Cat().cry()
    //    println(cat)
    println(new Dog().cry())
    println(new Other().cry())


    val injector = Guice.createInjector(new AnimalModule)
//    val cat = injector.getInstance(classOf[Cat])
//    println(cat.cry())
    val threadAnimal = injector.getInstance(classOf[AnimalThread])
    threadAnimal.run()

  }
}
